<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<%@ page contentType="text/html; charset=UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %>
<%@taglib prefix="shiro" uri="http://shiro.apache.org/tags" %>
<%
    String path = request.getContextPath();
%>
<c:set var="baseurl" value="${pageContext.request.contextPath}/"></c:set>
<html >
<head>
<link rel="stylesheet" type="text/css" href="${baseurl}CSS/backMange.css">
<!-- css资源 -->
<link rel="stylesheet" type="text/css" href="${baseurl}easyUI1.4.1/themes/default/easyui.css">
<!-- 图标资源 -->
<link rel="stylesheet" type="text/css" href="${baseurl}easyUI1.4.1/themes/icon.css">
<%-- <link rel="stylesheet" type="text/css" href="${baseurl}common/selectJs/example.css">
<link rel="stylesheet" type="text/css" href="${baseurl}common/selectJs/css/dropkick.css"> --%>
<link rel="stylesheet" type="text/css" href="${baseurl}common/easySelect/base.css">
<style>
   b{color:red;font-size:13px}
   .button_cz img{width:15px;margin:3px 10px 0 10px;}
   .button_cz div{font-size: 15px;color: #999;}
   .button_cz{cursor:hand}
   .button_cz div:hover{color:#57a0ff}
   input[type=text] {border: none;float: left;zoom:1;outline: medium;font-size: 14px;width:95%;background-color: #f2f2f2}
   .td_r{text-align: left;color: #626262;font-size: 14px;padding-left: 15px;border: 1px solid #efeff4;border-right: none;}
   .td_l{border: 1px solid #efeff4;border-left: none;}
   .all_select{text-align: center;color: #999999;font-size: 16px;width: 100%;}
    #preview{width:160px;height:100px;border:1px solid #000;overflow:hidden;}
    .hide{display:none}
   #imghead {filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(sizingMethod=image);}
</style>
<script type="text/javascript" src="${baseurl}easyUI1.4.1/jquery.min.js"></script>
<!--EasyUI的js包 -->
<script type="text/javascript" src="${baseurl}easyUI1.4.1/jquery.easyui.min.js"></script>
<!-- 树形图 -->
<script type="text/javascript" src="${baseurl}easyUI1.4.1/easyloader.js"></script>
<!-- 本地语言 -->
 <script type="text/javascript" src="${baseurl}easyUI1.4.1/locale/easyui-lang-zh_CN.js"></script>

<script type="text/javascript" src="${baseurl}common/easySelect/jquery.cssforms.js"></script>
<%@ include file="/WEB-INF/JSP/ajax.jsp"%>
<script>

//IE不支持console对象，此代码仅为测试使用
///////////////////////////////////////
window.console = window.console || (function () {
var c = {}; c.log = c.warn = c.debug = c.info = c.error = c.time = c.dir = c.profile  
= c.clear = c.exception = c.trace = c.assert = function () { };  
return c;  
})();

$(function(){
	
	$("#add_type_id").change(function(){
		
		  console.log($(this));
		  //切换为子菜单
			if($(this).val() == 'nav'){
				//显示
				//$("#add_trPmenu_id").attr("style","");//父菜单
				$("#add_trurlspan_id").attr("style","");//路径提示
				$("#add_trurl_id").attr("style","");//路径
				$("#add_trfisIndex_id").attr("style","");//选择是否主页
				//图片初始化
				$("#imghead").attr("src","${baseurl}images/myimages/uploadImg.png");
				$("#uploadImgButton").val("");
				//$("#imgTr_id").attr("style","");//子菜单不能选择图片
				
			}else{
				//隐藏
				//$("#add_trPmenu_id").attr("style","display:none");//父菜单
				$("#add_trurlspan_id").attr("style","display:none");//路径提示
				$("#add_trurl_id").attr("style","display:none");//路径
				//显示 操作图片
				//$("#imgTr_id").attr("style","");
				//父菜单清空路径，清空父菜单选项
				//$("#add_pMenu_id").val("");
				//$("#add_pMenuID_id").val("");
				$("#add_code_id").val("");
				//设置为非首页并隐藏
				$("#add_fisIndex_id").val("0");
				$("#add_trfisIndex_id").attr("style","display:none");
			}
			
		});
	
    $('#menu_list_table').treegrid({
        url:'${baseurl}DrivingSys/menu/alllist.action',
        method:'post',          //请求方式
        idField:'id',           //定义标识树节点的键名字段
        treeField:'menuName',       //定义树节点的字段
        fit:true,               //网格自动撑满
        fitColumns:true,        //设置为 true，则会自动扩大或缩小列的尺寸以适应网格的宽度并且防止水平滚动。
        animate:true,//是否用动画效果
        
        striped:true,   //斑马线效果
        singleSelect:false,          //是否单选
        
        collapsible:false,//是否可折叠
        showFooter:false,//是否使用页脚
        columns:[[
			{field: 'ck', checkbox: true, width: '30' },  //复选框  
            {field:'menuName',title:'名称',width:150,
					formatter:function(value,row,index){
	                    if(row.fisDelete == 1){
	                    	value = '<span style="text-decoration:line-through;color:red">'+row.menuName+'</span>';
	                    	return value;
	                    }
	         			else{
	         				value = '<span >'+row.menuName+'</span>';
	         				return value;
	         			}                        
	        		}
            },
            {field:'leavel',title:'层级',width:30,align:'center'},
			{field:'sortId',title:'排序',width:30,align:'center'},

            {field:'imgUrl',title:'菜单图标',width:60
            	,align:'center',
	                    formatter:function(value,row,index){
                            if ('' != value && null != value) {

                                value = '<img style="width:30px; height:30px" src="' + value + '">';

                            }
                            return value;
                        }
            },
            {field:'menuUrl',title:'菜单路径',width:70,align:'center'},
            {field:'fisIndex',title:'是否首页',width:40
            	,align:'center',
	                    formatter:function(value,row,index){
	                        if(value == '1'){return '<img style="width:20px; height:20px" src="${baseurl}easyUI1.4.1/themes/icons/ok.png">'}
	             			else if(value == '0'){return ''}                        
	            }
            },
            {field:'creatId',title:'创建人',width:50,align:'center'},
            {field:'creatTime',title:'创建时间',width:125,align:'center'},
            {field:'updateId',title:'修改人',width:50,align:'center'},
            {field:'updateTime',title:'修改时间',width:125,align:'center'}, 
            {field:'remark',title:'备注',width:150,align:'center'}
        ]],
        
	    onBeforeExpand:function(node){
	    	return;
		},
		onDblClick:function(node){
			console.log(node.menuName);
		},
		onLoadSuccess:function(){
			$('#menu_list_table').datagrid('clearSelections');
            //$('#menu_list_table').treegrid('collapseAll');//关闭所有  $('#menu_list_table').treegrid('expandAll')//展开所有
		}
    });
    
  //获取父菜单
    $("#Pmenu_list_table").datagrid({
    	 url:'${baseurl}DrivingSys/menu/PmenuList.action',  //数据来源 
        //冻结列
           columns:[[
               {field: 'ck', checkbox: true, width: '30' },  //复选框  
               {field:'menuName',title:'菜单名称',width:100,align:'center'},
               {field:'menuUrl',title:'菜单路径',width:170,align:'center'}
           ]],
           width:330,
           height:200,
           fitColumns:false,//自适应宽度，占满,不能和冻结列同时设置成true
           fit:true,//充满屏幕
           striped:true,   //斑马线效果
           idField:'id',    //主键列
           rownumbers:true,            //显示行号 
           singleSelect:true,          //是否单选
           //cache:false,				//关闭缓存
           method:'post',
           onLoadSuccess:function(){
           	$('#Pmenu_list_table').datagrid('clearSelections');
               return false;
           },
       	   onClickRow : function(index, row){
    			var selRow = $('#Pmenu_list_table').datagrid('getSelections')[0];
          	   $("#add_pMenu_id").val(selRow.menuName);
          	   $("#add_pMenuID_id").val(selRow.id);
          	   /*
          	   $("#update_company_input").val(selRow.companyName);
        	   $("#update_companyID_input").val(selRow.fid); */
          	 
          	   $('#Pmenu_window_div').window('close');
    	   },loadMsg:'请稍候...'
    })
});

</script>

</head>
<body style="overflow:hidden;">
	<table id="menu_list_table" toolbar="#tb"style="">
	</table>
	<div id="tb"style="background-color: #f5f5f5;">
		<div style="background-color: #fff;border-radius:10px 10px 0 0;padding-top:10px;padding-left:10px">
			<table>
				<tr>
					<shiro:hasPermission name="/menu/add.action">
						<td align="left">
							<div class="button_cz" onclick="add()">
								<table>
									<tr>
										<td><img src="${baseurl}images/myimages/xz.png"/></td>
										<td><div >新增</div></td>
									</tr>
								</table>
							</div>
						</td>
					</shiro:hasPermission>
					<shiro:hasPermission name="/menu/update.action">
						<td>
							<div class="button_cz" onclick="edit()">
								<table>
									<tr>
										<td><img src="${baseurl}images/myimages/xg.png"/></td>
										<td><div >修改</div></td>
									</tr>
								</table>
							</div>
						</td>
					</shiro:hasPermission>
					<shiro:hasPermission name="/menu/setdelete.action">
					<td>
						<div class="button_cz" onclick="setDelete('0')">
							<table>
								<tr>
									<td><img src="${baseurl}images/myimages/xg.png"/></td>
									<td><div >启用</div></td>
								</tr>
							</table>
						</div>
					</td>
					<td>
						<div class="button_cz" onclick="setDelete('1')">
							<table>
								<tr>
									<td><img src="${baseurl}images/myimages/xg.png"/></td>
									<td><div >停用</div></td>
								</tr>
							</table>
						</div>
					</td>
					</shiro:hasPermission>
					<td>
						<div class="button_cz" onclick="folderSet()">
							<table>
								<tr>
									<td><img src="${baseurl}images/myimages/CloseAndOpen.png"/></td>
									<td><div id="folder_set_id">全部闭合</div></td>
								</tr>
							</table>
						</div>
					</td>
				</tr>
			</table>
		</div>
	</div>
	<!-- 隐藏的添加窗口 -->
	<div id="add_window_div" class="easyui-window user_set_windows" title="添加菜单" 
			data-options="modal:true,closed:true,iconCls:'icon-save',top:50" style="width:500px;height:500px;display:none">
		<div style="padding:5px 10px 0px 5px">
	    <form id="add_window_form" method="post"style="width:480px;height:500px">
	    	<table width="470px">
	    		<tr height="40px;">
	    			<td width="39%" class="td_r"><b>*</b>菜单名称:</td>
	        		<td width="61%" class="td_l">
	        			<input type="text" value=""id="add_name_id" />
	        			<input type="text"style="display:none"id="mnenu_id" />
	        		</td>
	    		</tr>
	    		<tr>
	    			<td width="39%" class="td_r">菜单类型:</td>
	    			<td width="61%">
	    				<select class="all_select" id="add_type_id">
	    					<option value="sys">父菜单</option>
	    					<option value="nav" selected = "selected">子菜单</option>
						</select>
					</td>
	    		</tr>
	    		<tr height="40px" id="add_trurl_id">
	    			<td width="39%" class="td_r"><b>*</b>菜单路径:</td>
	        		<td width="61%" class="td_l">
	        			<input type="text" value=""id="add_code_id" />
	        		</td>
	    		</tr>
	    		<tr height="40px" id="add_trurlspan_id">
	    			<td width="39%" class="td_r">路径示例:</td>
	        		<td width="61%" class="td_l">
	        			<b>/user/look.action</b>
	        		</td>
	    		</tr>
				<tr height="40px" >
					<td width="39%" class="td_r">层级:</td>
					<td width="61%" class="td_l">
						<input type="text" value=""id="add_leavel_id" />
					</td>
				</tr>
				<tr height="40px" >
					<td width="39%" class="td_r">序号:</td>
					<td width="61%" class="td_l">
						<input type="text" value=""id="add_sort_id" />
					</td>
				</tr>
	    		<tr id="add_trfisIndex_id">
	    			<td width="39%" class="td_r">是否首页:</td>
	    			<td width="61%">
	    				<select class="all_select" id="add_fisIndex_id">
	    					<option value="1">&nbsp;&nbsp;是&nbsp;&nbsp;</option>
							<option value="0"selected = "selected">&nbsp;&nbsp;否&nbsp;&nbsp;</option>
						</select>
					</td>
	    		</tr>
	    		<tr id="add_trisdelete_id">
	    			<td width="39%" class="td_r">是否可用:</td>
	    			<td width="61%">
	    				<select class="all_select" id="add_isdelete_id">
	    					<option value="0">&nbsp;&nbsp;是&nbsp;&nbsp;</option>
							<option value="1">&nbsp;&nbsp;否&nbsp;&nbsp;</option>
						</select>
					</td>
	    		</tr>
	    		<tr height="40px"id="add_trPmenu_id" style="">
	    			<td width="39%" class="td_r">父菜单:</td>
	        		<td width="61%" class="td_l">
	        			<input type="text" value=""id="add_pMenu_id" onclick="opeanPmenu()"/>
	        			<input type="text" style="display:none"id="add_pMenuID_id" />
	        		</td>
	    		</tr>
	    		<tr>
	    			<td width="39%" class="td_r">备注:</td>
	    			<td  width="61%" class="td_l">
	    			<textarea id="add_remark_id" style="width:100%;resize:none"></textarea>
	    			</td>
	    		</tr>
	    		<tr id="imgTr_id">
	    			<td>
	    				<div id="preview"style="margin-left:10px">
						    <img id="imghead" width=100% height=auto border=0 
						    	src='${baseurl}images/myimages/uploadImg.png'
						    	onclick="uploadImgButton.click()">
						</div>
	    			
	    			</td>
	    			<td>
	    				<input id="uploadImgButton" type="file" onchange="previewImage(this)" />  
					</td>
					 
	    		</tr>
	    	</table>
	    </form>
	    <div style="text-align:center;padding:5px">
	    	<%-- <shiro:hasPermission name="/menu/update.action">
	    		<a href="javascript:void(0)"id="form_update_id" class="easyui-linkbutton"style="margin-right:100px;width:70px;height:30px;" onclick="submitForm()">提交</a>
	    	</shiro:hasPermission> --%>
	    	<a href="javascript:void(0)"id="form_add_id" class="easyui-linkbutton"style="margin-right:100px;width:70px;height:30px;" onclick="submitForm()">提交</a>
	    	<a href="javascript:void(0)" class="easyui-linkbutton"style="width:70px;height:30px;" onclick="javascript:$('#add_window_div').window('close')">关闭</a>
	    </div>
	    </div>
	</div>

	<div id="Pmenu_window_div" class="easyui-window user_set_windows" title="选择父菜单" 
			data-options="modal:true,closed:true,iconCls:'icon-save',top:120" 
			style="width:350px;height:300px;display:none">
			<table id="Pmenu_list_table">
			</table>
	</div>
</body>
<script type="text/javascript" src="${baseurl}common/upImg/upImg.js"></script>

<script>
var $folder_menu_list=true;
function folderSet() {
    $.messager.progress({});
	if($folder_menu_list)
	{
	    $("#folder_set_id").text("全部展开");
        $('#menu_list_table').treegrid('collapseAll');
	}
	else
	{
        $("#folder_set_id").text("全部闭合");
        $('#menu_list_table').treegrid('expandAll');
	}
    $folder_menu_list = !$folder_menu_list;
    setTimeout(function(){
        //关闭遮罩
        $.messager.progress('close');
	},1500);

}
var menuHandFlag = '';
//打开父菜单选择窗口
function opeanPmenu(){
	$('#Pmenu_list_table').datagrid('clearSelections');//清空已选项
	$('#Pmenu_list_table').datagrid('load');
	$("#Pmenu_window_div").attr("style","width:350px;height:300px");
	$('#Pmenu_window_div').window('open');
}
function add(){
	/* $("#form_update_id").css("display","none");
	$("#form_add_id").css("display","inline-block"); */
	//用户可以在制定菜单下添加子菜单。
	var thisBean = $('#menu_list_table').datagrid('getSelections');
	if( thisBean.length>1){
		$.messager.alert('提示','新增子菜单只能有一个父菜单!');
		return;
		//用户选择了一项
	}else if( thisBean.length == 1){
		//判断该菜单是否为最底层菜单
		if(thisBean[0].menuUrl !=null &&
				thisBean[0].menuUrl !=""){
			$.messager.alert('提示','该菜单不能作为父菜单!');
			return;
		}else{
			//设置父菜单
			$("#add_pMenu_id").val(thisBean[0].menuName);
			$("#add_pMenuID_id").val(thisBean[0].id);
		}
	}else{
		$("#add_pMenu_id").val("");
		$("#add_pMenuID_id").val("");
	}
	menuHandFlag = 'add';
	//图片初始化
	$("#uploadImgButton").val("");
	img = null;
	//初始化
	$('#add_name_id').val("");//姓名
	$("#add_code_id").val("");//路径
	$("#add_type_id").val("nav");//类型
	$("#add_remark_id").val("");//备注
	$("#add_fisIndex_id").val("0");//非首页
	//设置主页选项显示
	$("#add_trisdelete_id").val("");
	$("#add_trfisIndex_id").attr("style","");
	//隐藏
	$("#add_trurl_id").attr("style","");//显示路径设置
	$("#add_trisdelete_id").attr("style","display:none");//选择是否可用
	//图片初始化
	$("#imghead").attr("src","${baseurl}images/myimages/uploadImg.png");
	$("#uploadImgButton").val("");
	//$("#imgTr_id").attr("style","display:none");//子菜单不能选择图片
	//打开添加窗口
    $('#add_window_div').panel({title: "添加菜单"});
	$("#add_window_div").attr("style","width:500px;height:550px;");
	$('#add_window_div').window('open');
}
function edit(){

	/* $("#form_update_id").css("display","inline-block");
	$("#form_add_id").css("display","none"); */
    var thisBean = $('#menu_list_table').datagrid('getSelections');
    if( thisBean.length == 0 || thisBean.length>1){
        $.messager.alert('提示','请正确选择修改行!');
        $('#menu_list_table').datagrid('clearSelections');
        return;
    }
	$("#uploadImgButton").val("");
	menuHandFlag = 'update';
	//初始化
	 $('#add_name_id').val("");
	$("#add_code_id").val("");
	$("#add_type_id").val("nav");
	$("#add_pMenu_id").val("");
	$("#add_pMenuID_id").val("");
	$("#add_remark_id").val("");
    $("#add_leavel_id").val("");
    $("#add_sort_id").val("");
	//隐藏
	$("#add_trisdelete_id").attr("style","");
    $('#add_window_div').panel({title: "修改菜单"});
    $("#add_window_div").attr("style","width:510px;height:550px;");
	$('#add_window_div').window('open');

	var thisId = thisBean[0].id;
	
	$.ajax({
	      url:'${baseurl}DrivingSys/menu/menudata.action',  
	      type: "post",  
	      dataType:"json",
	      //timeout : 10000,
	      data:{"id":thisId}, 
	      success: function(json) {
	    	$("#update_window_div").attr("style","width:350px;height:350px;");
	    	$('#update_window_div').window('open');
	      	var menu = json.menu;
	      	$("#mnenu_id").val(menu.id);
	    	$('#add_name_id').val(menu.menuName);
	    	$("#add_code_id").val(menu.menuUrl);
	    	$("#add_type_id").val(menu.menuType);
	    	$("#add_pMenu_id").val(menu.pmenuName);
	    	$("#add_pMenuID_id").val(menu.parentId);
	    	$("#add_remark_id").val(menu.remark);
	    	$("#add_isdelete_id").val(menu.fisDelete);
	    	$("#add_fisIndex_id").val(menu.fisIndex);

            $("#add_leavel_id").val(menu.leavel);
            $("#add_sort_id").val(menu.sortId);

	    	if(menu.imgUrl == null || menu.imgUrl == ""){
	    		$("#imghead").attr("src","${baseurl}images/myimages/uploadImg.png");
	    	}else{
	    		$("#imghead").attr("src",menu.imgUrl);
	    	}
	    	img = null;
	    	if(menu.menuType == 'nav'){
				$("#add_trurlspan_id").attr("style","");
				$("#add_trurl_id").attr("style","");
				$("#add_trfisIndex_id").attr("style","");
				//$("#uploadImgButton").val("");
				//$("#imgTr_id").attr("style","display:none");
			}else{
				$("#imgTr_id").attr("style","");
				$("#add_trurlspan_id").attr("style","display:none");
				$("#add_trurl_id").attr("style","display:none");
				$("#add_fisIndex_id").val("0");
				$("#add_trfisIndex_id").attr("style","display:none");
			}
	    	
	      },error:function(){
	      	$.messager.progress('close');
	      	$.messager.alert('提示','请刷新页面重试!','warning');
	      }
	  });
	
}
//修改提交并验证表单
function submitForm(str){
	var id = $("#mnenu_id").val();
	var menuName = $('#add_name_id').val();
	var menuName = $('#add_name_id').val();
	var menuUrl = $('#add_code_id').val();
	var menuType = $("#add_type_id").val();
	var pMenuID = $("#add_pMenuID_id").val();
	var remark = $('#add_remark_id').val();
	var fisDelete = $("#add_isdelete_id").val();
	var fisIndex = $("#add_fisIndex_id").val();
	var leavel =$("#add_leavel_id").val()*1;
    var sortid =$("#add_sort_id").val()*1;
	if(menuName ==null || menuName == "" ){
		$.messager.alert('提示','菜单名称必须填写!');
		return;
	}
	if(isNaN(leavel) || leavel < 1)
	{
        $.messager.alert('提示','菜单层级不符合规范!');
        return;
	}
    /*if(isNaN(sortid) || sortid < 1)
    {
        $.messager.alert('提示','菜单排序不符合规范!');
        return;
    }*/
	if(menuType == 'nav'){
		if(menuUrl == null || menuUrl == ""){
			$.messager.alert('提示','子菜单类型必须填写路径!');
			return;
		}
		var patrn=/(\/\w+)+/;
		if(!patrn.test(menuUrl)){
			$.messager.alert('提示','路径不符合要求!');
			return true;     
		}
	}
	if(checkStr(menuName)||checkStr(remark)){
		return;
	}
	// /user/add.action
	
	if(menuType == 'nav'){
		if(pMenuID == null || pMenuID == ""){
			$.messager.alert('提示','单击选择父菜单!');
			return;
		}
	}
	if(fisIndex == null || fisIndex == ""){
		fisIndex = 0;
	}
	if(fisDelete == null || fisDelete == ""){
		fisDelete = 0;
	}
	var uploadImg = null;
	if(img != null){
		uploadImg = img.currentSrc
	}
	var url = '${baseurl}DrivingSys/menu/'+menuHandFlag+'.action';
	var data = {"id":id*1,"fisIndex":fisIndex,"menuName":menuName,"menuUrl":menuUrl,
				"menuType":menuType,"parentId":pMenuID,"img":uploadImg,
				"fisDelete":fisDelete,"remark":remark,"sortId":sortid,"leavel":leavel};
	$.ajax({
	      url:url,  
	      type: "post",  
	      dataType:"json",
	      //timeout : 10000,
	      data:data, 
	      success: function(json) {
	    	  console.log("---")
	    	  console.log(json);
	    	  if(json.success <=0 ){
		        	$.messager.alert('提示','操作失败，请刷新页面重试!','warning');
	        	}else{
		        	$.messager.show({
						title:'提示',
						msg:'设置成功!',
						timeout:3000,
						showType:'slide'
					});
		        	$('#add_window_div').window('close')
		        	doSearch();
	        	}
	      },error:function(){
	      	$.messager.progress('close');
	      	$.messager.alert('提示','请刷新页面重试!','warning');
	      }
	  });
}	
//启用停用
function setDelete(isDelete){
		var selRow = $('#menu_list_table').datagrid('getSelections') ;
		if (selRow.length==0) {
	      $.messager.alert("提示", "请选择要操作的行！", "info");  
	      return;  
    	}
		var ids="";  
		//批量获取选中行的评估模板ID  
	    for (i = 0; i < selRow.length;i++) {
		  	if(isDelete == '0'&& selRow[i].fisDelete == '0'){
		  		continue;
		  	}
		  	if(isDelete == '1'&& selRow[i].fisDelete == '1'){
		  		continue;
		  	}
		    if (ids =="") {  
		      	ids = selRow[i].id;  
		    } else {
		      	ids = selRow[i].id +"," + ids;  
		    }      
	    }  
		if(ids == ""){
		  	$.messager.alert("提示", "选中的可用户必须大于一人！", "info"); 
		  	return;
		}
		
		$.ajax({
	        url:'${baseurl}DrivingSys/menu/setdelete.action',  
	        type: "post",  
	        dataType:"json",
		    data:{"ids":ids,"isDelete":isDelete}, 
	        success: function(json) {
	        	if(json.success == undefined || json.success == 'undefined'){
		        	$.messager.alert('提示','操作失败，请刷新页面重试!','warning');
	        	}else{
		        	$.messager.show({
						title:'提示',
						msg:'设置成功!',
						timeout:3000,
						showType:'slide'
					});
		        	doSearch();
	        	}
	        },error:function(){
	        	$.messager.progress('close');
	        	$.messager.alert('提示','操作失败，请刷新页面重试!','warning');
	        }
	    })
}
//菜单查询
function doSearch(){
	
	//清除用户checked项
	$('#menu_list_table').datagrid('clearSelections');
	/* var menuName = $('#menu_name_id').val();
	var menuType = $('#menu_ftype_id').val();
	var fisDelete = $('#menu_fisdelete_id').val();
	var PmenuName = $('#menu_Pname_id').val();
	var fisIndex = $("#menu_fisIndex_id").val(); */
	//保留页码查询
	$('#menu_list_table').treegrid('reload');
}

function checkStr(str){
	var patrn=/[!#@$%^&*()_+<>?:"{},\/;'[\]]/;
	if(patrn.test(str)){
		$.messager.alert('提示','请不要使用非中文符号!');
		return true;     
	}
	return false;
}
</script>
</html>